#pragma once
#include "loadUtils.h"
/**
 * @brief Struct for storing client data
 */
struct ClientVars{
	char id[7];
	char name[30];
	char surname[30];
	char address[30];
	char town[20];
	char province[30];
	char email[40];
	char password[40];
	unsigned int balance;
};
/**
 * @brief Array of ClientVars structs, allocated dynamically later on
 */
struct ClientVars *clientdata;

/**
 * @brief keeps count of how many clients we have, also used for memory reallocation
 */
int clientcount;

/**
 * @brief Load client file into memory
 *
 * @param filename
 *
 * @return return code
 */
int loadClients(char const *filename);

/**
 * @brief save clientdata to file
 *
 * @param filename
 *
 * @return return code
 */
int writeClients(char const *filename);

/**
 * @brief add a client to the vector, reallocates if needed
 *
 * @param n
 */
void addClient(struct ClientVars n);

/**
 * @brief removes a client by index, find it yourself first ;)
 *
 * @param index
 */
void rmClient(int index);
